import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { EmgPlanDetailVO, EmgPlanDetailForm, EmgPlanDetailQuery } from '@/api/biz/emgPlanDetail/types';

/**
 * 查询应急预案详情列表
 * @param query
 * @returns {*}
 */

export const listEmgPlanDetail = (query?: EmgPlanDetailQuery): AxiosPromise<EmgPlanDetailVO[]> => {
  return request({
    url: '/biz/emgPlanDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询应急预案详情详细
 * @param id
 */
export const getEmgPlanDetail = (id: string | number): AxiosPromise<EmgPlanDetailVO> => {
  return request({
    url: '/biz/emgPlanDetail/' + id,
    method: 'get'
  });
};

/**
 * 新增应急预案详情
 * @param data
 */
export const addEmgPlanDetail = (data: EmgPlanDetailForm) => {
  return request({
    url: '/biz/emgPlanDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改应急预案详情
 * @param data
 */
export const updateEmgPlanDetail = (data: EmgPlanDetailForm) => {
  return request({
    url: '/biz/emgPlanDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除应急预案详情
 * @param id
 */
export const delEmgPlanDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/emgPlanDetail/' + id,
    method: 'delete'
  });
};
